/**
*  \file assertor_cfg.h
*
*  \brief Configuration of assertor exception handling.
*
*  \author Michael J. Hohmann <michael.hohmann@linde-mh.de>
*
*
*/

#ifndef ASSERTOR_CFG_H_INCLUDED
#define ASSERTOR_CFG_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"
#include "../test/test.h"

/*================================================[ public defines   ]================================================*/

static inline void ASSERTOR_function( const CH* func, BO condition, const CH *condition_string,const CH *explanation, const CH* filename, U32 line, CH const * func_name )
{
	if( !condition )
	{
		test_catch_exception( explanation, filename, line, func_name );
	}
}

#define ASSERTOR_ILLEGAL_DEFAULT_CALL( explanation )	ASSERTOR_function( "ILLEGAL_DEFAULT",  FALSE , "FALSE", explanation,  __FILE__, __LINE__, __func__ )

#define ASSERTOR_PRE_CALL(  condition, explanation ) 	ASSERTOR_function( "PRE",  condition, #condition, explanation,  __FILE__, __LINE__, __func__ )

#define ASSERTOR_CHK_CALL(  condition, explanation ) 	ASSERTOR_function( "CHK",  condition, #condition, explanation,  __FILE__, __LINE__, __func__ )

#define ASSERTOR_INV_CALL(  condition, explanation ) 	ASSERTOR_function( "INV",  condition, #condition, explanation,  __FILE__, __LINE__, __func__ )

#define ASSERTOR_POST_CALL( condition, explanation ) 	ASSERTOR_function( "POST", condition, #condition, explanation,  __FILE__, __LINE__, __func__ )

/*================================================[ public datatypes ]================================================*/

/*================================================[ public variables ]================================================*/

/*================================================[ public functions ]================================================*/

/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2014 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
